/*
 * @Author: zhongfei
 * @创建时间:2023\12\29
 * @描述:主页
 */

import 'package:card_display/view/controllers/home_controller.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:card_swiper/card_swiper.dart';


/**
 * @Author: zhongfei
 * @创建时间:2023\12\29
 * @描述: 主页
 */
class Home extends GetView<HomeController>  {
  const Home({super.key});
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        width: Get.width,
        height: Get.height,
       child: bannerImgWidget(),
      )
    );
  }



  Widget bannerImgWidget(){
    return  Swiper(
      autoplay: true,//自动轮播
      autoplayDelay: 10*1000,//轮播间隔
      itemBuilder: (BuildContext context,int index){
        return Image.asset(controller.bannList[index]['img'],width: Get.width,height:Get.height,fit: BoxFit.fill,);
      },
      itemCount: controller.bannList.length,
      pagination: SwiperPagination(),
    );
  }


}
